Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MBR narrow-phase collision logic #1168

Merged
merged 1 commit into from
Jan 15, 2018

Conversation

starwed
Copy link
Member

@starwed starwed commented Jan 15, 2018

The narrow phase collision check was always returning true for 'MBR' type collisions.

(If you look at the fix, you'll see this was a pretty dumb goof on my part!)

I added unit tests for this specific case.

The narrow phase collision check was always returning true for 'MBR' type collisions.
@starwed starwed merged commit c905770 into craftyjs:develop Jan 15, 2018
@starwed starwed deleted the mbr-collision-fix branch January 15, 2018 19:24
.attr({x: 0, y: 0, w: 2, h: 2});
var results = e1.hit('2D');
_.strictEqual(results.length, 1, "exactly one collision");
_.strictEqual(results[0].type, "MBR", "expecdted MBR collision type");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants